<template>
  <span>
    <el-tooltip content="设置自动刷新间隔，单位为秒。设置为 0 则停止刷新。">
      <!-- 这里难以定制数字输入框的宽度 -->
      <el-input-number 
        :value="value"
        @input="$emit('input', $event)"
        controls-position="right" size="mini" :min="0"
      />
    </el-tooltip>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <el-tooltip content="点击我立即刷新（快捷键 'R'）">
      <el-button round size="mini" icon="el-icon-refresh" :loading="loading" @click="$emit('refresh')">
      </el-button>
    </el-tooltip>
  </span>
</template>

<script>
export default {
  name: 'IntervalSetting',
  props: {
    value: Number,
    loading: Boolean
  }
}
</script>
